Micron Document
🎖️GitЯра🎖️

Node / meshcore / MeshCore / files / src / helpers / ui / GenericVibration.h

Displaying Raw • Download

src/helpers/ui/GenericVibration.h 5732b2edd8563281ef7d344cd6517f969ca160ab (5732b2ed) Text, 773 B

Tff7b72#Tff7b72pragma once

Tff7b72#Tff7b72ifdef PIN_VIBRATION

Tff7b72#Tff7b72include T8b949e<Arduino.h>

T8b949e/*
* Vibration motor control class
*
* Provides vibration feedback for events like new messages and new contacts
* Features:
* - 1-second vibration pulse
* - 5-second nag timeout (cooldown between vibrations)
* - Non-blocking operation
*/

Tff7b72#Tff7b72ifndef VIBRATION_TIMEOUT
Tff7b72#Tff7b72define VIBRATION_TIMEOUT 5000 T8b949e// 5 seconds default
Tff7b72#Tff7b72endif

Te6edf3class Te6edf3GenericVibration Tb4b4b4{
Te6edf3publicTff7b72:
Tffa657void Te6edf3beginTb4b4b4(Tb4b4b4)Tb4b4b4; T8b949e// set up vibration pin
Tffa657void Td2a8fftriggerTb4b4b4(Tb4b4b4)Tb4b4b4; T8b949e// trigger vibration if cooldown has passed
Tffa657void Td2a8ffloopTb4b4b4(Tb4b4b4)Tb4b4b4; T8b949e// non-blocking timer handling
Tffa657bool Td2a8ffisVibratingTb4b4b4(Tb4b4b4)Tb4b4b4; T8b949e// returns true if currently vibrating
Tffa657void Td2a8ffstopTb4b4b4(Tb4b4b4)Tb4b4b4; T8b949e// stop vibration immediately

Te6edf3privateTff7b72:
Tffa657unsigned Tffa657long Te6edf3durationTb4b4b4;
Tb4b4b4}Tb4b4b4;

Tff7b72#Tff7b72endif T8b949e// ifdef PIN_VIBRATION

Served by rngit 1.5.2 - Generated in 0.03s